 function calInsuruce(money, rate, cycle) {
        const arr = [];
        let curMoney = money;
        for (let i = 1; i <= cycle; i++) {
          if (i === 1) {
            arr.push({money: curMoney});
          } else {
            const len = arr.length;
            curMoney = +(curMoney * (1 + rate)).toFixed(2);
            arr.push({
              money: curMoney,
              earn: +(curMoney - arr[len - 1]?.money).toFixed(2),
            });
          }
        }
        const total = arr.reduce((total, item) => total + item.money, 0);
        // console.log((+total).toLocaleString());
        return arr;
      }

      console.log(calInsuruce(100000, 0.025, 10));